const initialState = { 
    value: 0,
    user: {}
}

const reducer = (state = initialState, action) => {
    const d = action.data
    switch(action.type) {
        case 'setGlobalValue':
            return {
                ...state,
                value: d
            }
        case 'setGlobalUser':
            return {
                ...state,
                user: d
            }
        default: 
            return state
    }
}

export default reducer;